package hhm.javamode.composite.duck;

/**
 * Created by Administrator on 2017/1/23.
 */
public class QuackCounter implements Quackable {

    Quackable duckQuackable;
	static int numberofQuacks;

    public QuackCounter(Quackable duck)
    {
        this.duckQuackable =duck;
    }
    @Override
    public void quack() {
        duckQuackable.quack();
        numberofQuacks++;
    }

    public static int getQuacks()
    {
        return numberofQuacks;
    }
}
